<?php
	$ywoperate= new Ywoperate();
	$order = 'id DESC';
	$limit = 5;	
	$offset = isset($_GET['offset'])?$_GET['offset']:0;
	$operate = $ywoperate->getFlag();
	//print_r($operatelist);
?>
<table class="tablelist" >
<tr>
<th>主题</th>
<th>操作人</th>
<th>添加时间</th>
<th>操作</th>
</tr>
<?php if(!empty($operate)):?>

<?php foreach ($operate as $op):
	//$_SESSION['operate'.$operate['id']] = $operate;
?>
<tr>
	<td style="display:none">	<?php if(isset($op['id'])): echo $op['id'];?><?php endif ?>
	</td>
	<td width="20%">	<?php if(isset($op['title'])): echo $op['title'];?><?php endif ?>
	</td>
	<td width="10%">
		<pre><?php echo isset($op['name'])?$op['name']:'无';?></pre>
	</td>
	<td width="10%">
		<pre><?php echo isset($op['optime'])?$op['optime']:'无';?></pre>
	</td>
	<td width="10%">
		<input onclick="callback_drop()" name="flag" type="button" value="取消关注" class="flag" id="<?php echo $op['id'];?>"> 
	</td>
</tr>
<?php endforeach; ?>

<?php else : ?>
<tr>
	<h1 style='text-align:center;color:red;'>当前没有记录，请添加！</h1>
</tr>
<?php endif;?>
</table>
<script type="text/javascript">
function callback_drop()
{	
	$("input[name='flag']").each(function()
			{
			
					id = $(this).attr('id');
				}
			);
	$.get("/ajaxlist.php?act=ywoperate",{id:id},function(data)
	{
		if(data['status']=='y')
		{
			 alert('操作成功');
			// $operatelist=$data['list'];
			 window.location.reload();
		}
		else
		{
			alert('操作失败');
		}
	},'json');
}
</script>